package cn.yitun.chat.yitunserverimcore.general.main.biz.contact.manager;

import cn.yitun.chat.yitunservercommonlib.dataentity.vo.contact.ContactHarassSettingVo;
import cn.yitun.chat.yitunservercommonlib.enums.groupChat.GroupJoinVerifySettingTypeEnums;
import cn.yitun.chat.yitunserverimbase.dao.contact.ContactHarassSettingDao;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 
 * Date 2019-01-20 13:37:17<br>
 * Description
 * 
 * @author yitun<br>
 * @version 1.1
 */
@Service
public class ContactHarassSettingManager {

	@Resource
	private ContactHarassSettingDao contactHarassSettingDAO;

	/**
	 * 获取用户屏蔽规则
	 * @param userId
	 * @return
	 */
	public ContactHarassSettingVo getByUserId(Long userId) {
		ContactHarassSettingVo uhs = contactHarassSettingDAO.getVOByUserId(userId);
		if (null == uhs) {
			uhs = new ContactHarassSettingVo();
			uhs.setVerifyType(GroupJoinVerifySettingTypeEnums.VERIFY_TYPE_AUTH.getType());
		}
		return uhs;
	}
}
